﻿using MineMES.Domain.Entity;
using Microsoft.AspNetCore.Mvc;
using MineMES.Application;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using MineMES.Application.DTO;
using System;
using MineMES.Api.Controllers.Common;

namespace MineMES.Api.Controllers
{
    //[ApiController]
    //[Route("[controller]")]
    public class LoginController : BaseController
    {
        SysUserApps _SysUserApps;
        public LoginController(SysUserApps sysUserApps)
        {
            _SysUserApps = sysUserApps;
        }

        [HttpPost]
        //[Route("[controller]")]
        public Result Log(SysUserDto logUser)
        {
            return _SysUserApps.Log(logUser);
        }

        [HttpPost]
        //[Route("[controller]")]
        public Task<Result> Load(Request request)
        {
            return _SysUserApps.Load(request);
        }

        [HttpPut]
        //[Route("[controller]")]
        public Result Update(Sys_User sysUser)
        {
            return _SysUserApps.Update(sysUser);
        }

        [HttpPost]
        //[Route("[controller]")]
        public Result Add(Sys_User sysUser)
        {
            return _SysUserApps.Add(sysUser);
        }

        [HttpDelete]
        //[Route("[controller]")]
        public Result Delete(string ids)
        {
            return _SysUserApps.Delete(ids);
        }

        public Result Export()
        {
            return _SysUserApps.Export();
        }
    }
}
